﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Sinacor.OMM.Deployment.SetupConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            GetTNSNames();
        }

        private static void InstallWindowsService()
        {
            try
            {
                new Setup.Steps.InstallWindowsService().Execute("ReceptorService", "BM&FBOVESPA Receptor Service", "Sinacor.OMM.Receptor.exe", Setup.Parameter.Enums.SetupMode.Uninstall);               

            }
            catch (Exception ex)
            {
                Console.Write(ex.Message);
                Console.ReadLine();
            }
        }

        private static void InstallMSMQ()
        {
            try
            {
                new Setup.Steps.InstallMSMQ().Execute(@".\Private$\MQTESTE", Setup.Parameter.Enums.SetupMode.Uninstall);
            }
            catch (Exception ex)
            {
                Console.Write(ex.Message);
                Console.ReadLine();
            }
        }

        private static void CheckPreRequisites()
        {
            Setup.Steps.CheckPreRequisites pr = new Sinacor.OMM.Deployment.Setup.Steps.CheckPreRequisites();
            Console.Write("Componente MSMQ: " + pr.CheckMSMQInstalled());
            Console.Write("\nComponente STM: " + pr.CheckSTMInstalled());
            Console.Write("\nComponente OracleClient ODP: " + pr.CheckOracleInstalled());
            Console.Write("\nSinacor: " + pr.CheckSinacorInstalled());
            Console.ReadLine();
        }

        private static void GetTNSNames()
        {
            Setup.Steps.OracleConnection oc = new Sinacor.OMM.Deployment.Setup.Steps.OracleConnection();
            
            List<string> list = oc.GetTNSNames();

            foreach (string s in list)
            {
                Console.Write(s + "\n");
            }

            Console.ReadLine();
        }
    }
}